var a = require("../../../@babel/runtime/helpers/defineProperty"), t = getApp();

Page({
    data: {
        avatarInfo: {},
        list: [],
        page: 1
    },
    onLoad: function(a) {
        wx.setNavigationBarTitle({
            title: "业绩统计"
        }), this.getData();
    },
    showGoodTap: function(t) {
        console.log(t);
        var e = t.currentTarget.dataset.item, o = t.currentTarget.dataset.ind;
        e.moreShow || this.setData(a({}, "list[" + o + "].moreShow", !0));
    },
    goteam: function() {
        wx.navigateTo({
            url: "/packageI/allowanceIndex/allowanceTeam/allowanceTeam"
        });
    },
    toDetail: function() {
        wx.navigateTo({
            url: "/packageI/allowanceIndex/allowanceDetail/allowanceDetail"
        });
    },
    tapGetMoreGood: function(a) {
        var t = a.currentTarget.dataset.item, e = a.currentTarget.dataset.index;
        console.log(t, e), console.log(this.data.list[e]), t.goodsShow ? this.data.list[e].goodsShow = !1 : this.data.list[e].goodsShow = !0, 
        this.setData({
            list: this.data.list
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.data.current_page >= this.data.last_page || (this.setData({
            page: this.data.page + 1
        }), this.getMoreData());
    },
    onShareAppMessage: function() {},
    getData: function() {
        var a = this, e = t.getNetAddresss("plugin.agency-subsidy.frontend.controllers.performance.index");
        t._getNetWork({
            url: e,
            data: {
                page: this.data.page
            },
            success: function(e) {
                var o = e.data;
                if (1 != o.result) return t.tips(o.msg);
                for (var s = 0; s < o.data.list.data.length; s++) o.data.list.data[s].goodsShow = !1;
                a.setData({
                    avatarInfo: o.data.info,
                    list: o.data.list.data,
                    current_page: o.data.list.current_page,
                    last_page: o.data.list.last_page
                });
            }
        });
    },
    getMoreData: function() {
        var a = this, e = t.getNetAddresss("plugin.agency-subsidy.frontend.controllers.performance.index");
        t._getNetWork({
            url: e,
            data: {
                page: this.data.page
            },
            success: function(e) {
                var o = e.data;
                if (1 != o.result) return t.tips(o.msg);
                for (var s = 0; s < o.data.list.data.length; s++) o.data.list.data[s].goodsShow = !1;
                var n = o.data.list.data;
                a.data.list = a.data.list.concat(n), a.setData({
                    list: a.data.list,
                    current_page: o.data.list.current_page,
                    last_page: o.data.list.last_page
                });
            }
        });
    }
});